package com.qdu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qdu.entity.Rent;
import com.qdu.mapper.RentMapper;
import com.qdu.service.RentService;

@Service
public class RentImpl implements RentService {


	
	@Autowired
	private RentMapper rentMapper;
	


	@Override
	public List<Rent> getRentById(String resident) {
		return rentMapper.getOneByresident(resident);
	}

	@Override
	public List<Rent> getRentList() {
		return rentMapper.getAll();
	}

	@Override
	public Rent getonerent(String resident, String houseowner, String hid) {
		return rentMapper.getOneById(resident, houseowner, hid);
	}

	@Override
	public List<Rent> getbyhouseowner(String houseowner, String hid) {
		return rentMapper.getbyhouseowner(houseowner, hid);
	}


	@Override
	public void addRent(com.qdu.entity.Rent r) {
		rentMapper.insert(r);
	}

	@Override
	public void deleteRent(String resident, String houseowner, String hid) {
		rentMapper.delete(resident, houseowner, hid);
	}

	
	
	



}
